<template>
  <div class="home">
    <div class="recent-blogs">Recent Blogs</div>
    <BlogPreviewList :blog-path-list="blogPathList" />
  </div>
</template>

<script setup lang="ts">
import path from "path-browserify";
import { onMounted, ref } from "vue";
import global from "@/global";

import BlogPreviewList from "@/components/BlogPreviewList.vue";
let blogPathList = ref([""]);

onMounted(() => {
  global.getLinks(path.join(global.blogDir, "index.md"), (err, data) => {
    if (err) {
      throw err;
    }
    blogPathList.value = data;
  });
});
</script>

<style scoped></style>
